package cn.kgc.jinxin.clothesstore.entity;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

public class Order {
	private Long orderId;
	private User user;
	private Date orderTime;
	private String receiver;
	private String receiverPhone;
	private String receiverAddress;
	private Double orderTotalPrice;
	private List<OrderDetail> orderDetailList = new ArrayList<>();
	public Long getOrderId() {
		return orderId;
	}
	public void setOrderId(Long orderId) {
		this.orderId = orderId;
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Date getOrderTime() {
		return orderTime;
	}
	public void setOrderTime(Date orderTime) {
		this.orderTime = orderTime;
	}
	public String getReceiver() {
		return receiver;
	}
	public void setReceiver(String receiver) {
		this.receiver = receiver;
	}
	public String getReceiverPhone() {
		return receiverPhone;
	}
	public void setReceiverPhone(String receiverPhone) {
		this.receiverPhone = receiverPhone;
	}
	public String getReceiverAddress() {
		return receiverAddress;
	}
	public void setReceiverAddress(String receiverAddress) {
		this.receiverAddress = receiverAddress;
	}
	public Double getOrderTotalPrice() {
		this.orderTotalPrice=0d;
		for(OrderDetail orderDetail:this.orderDetailList) {
			this.orderTotalPrice+=orderDetail.getSubPrice();
		}
		return orderTotalPrice;
	}
	public void setOrderTotalPrice(Double orderTotalPrice) {
		this.orderTotalPrice = orderTotalPrice;
	}
	public OrderDetail[] getOrderDetailList() {
	
		return this.getOrderDetailList();
	}
	
}
